package com.example.wyz.classplus.bean;

import android.util.Log;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by 10153 on 2017/6/30.
 */

public class Course {

    private int courseID;
    private String courseName;
    private String classroom;
    private int [] duration = new int[2];
    private int week;
    private int [] period = new int [2];
    private String teacher;
    private int color;

    public Course(int courseID,
                  String courseName,
                  String classroom,
                  int[] duration,
                  int week,
                  int[] period,
                  String teacher) {
        this.courseID = courseID;
        this.courseName = courseName;
        this.classroom = classroom;
        this.duration = duration;
        this.week = week;
        this.period = period;
        this.teacher = teacher;
        this.color = -1;
    }

    public int getCourseID() {
        return courseID;
    }

    public String getCourseName() {
        return courseName;
    }

    public String getClassroom() {
        return classroom;
    }

    public int[] getDuration() {
        return duration;
    }

    public int getWeek() {
        return week;
    }

    public int[] getPeriod() {
        return period;
    }

    public String getTeacher() {
        return teacher;
    }

    public int getColor() {
        return color;
    }

    public void setCourseID(int courseID) {
        this.courseID = courseID;
    }

    public void setCourseName(String courseName) {
        this.courseName = courseName;
    }

    public void setClassroom(String classroom) {
        this.classroom = classroom;
    }

    public void setDuration(int[] duration) {
        this.duration = duration;
    }

    public void setWeek(int week) {
        this.week = week;
    }

    public void setPeriod(int[] period) {
        this.period = period;
    }

    public void setTeacher(String teacher) {
        this.teacher = teacher;
    }

    public void setColor(int color) {
        this.color = color;
    }

    public boolean isSameFrom(Course course){
        boolean isSame = (this.courseName.equals(course.courseName) &&
                this.teacher.equals(course.teacher));
        Log.d("Course", "isSameFrom: "+isSame);
        return isSame;
    }

    public static List<Course> getTestData(){
        List<Course> courses = new ArrayList<>();
        courses.add(new Course(0, "数据库", "品学楼A407", new int[]{2, 16}, 1, new int[]{3, 4}, "孙明"));
        courses.add(new Course(0, "汇编语言", "主楼A2区412", new int[]{4, 5}, 1, new int[]{5, 8}, "孙明"));
        courses.add(new Course(1, "数学建模实验", "科A407", new int[]{4, 16}, 1, new int[]{9, 11}, "汪小平"));
        courses.add(new Course(2, "计算机网络", "品学楼C407", new int[]{2, 14}, 2, new int[]{1, 2}, "龚海刚"));
        courses.add(new Course(0, "羽毛球", "", new int[]{2, 17}, 2, new int[]{3, 4}, "金辉"));
        courses.add(new Course(0, "数字逻辑", "品学楼B304", new int[]{1, 17}, 2, new int[]{5, 6}, "文泉"));
        courses.add(new Course(0, "汇编语言", "主楼A2区412", new int[]{4, 5}, 3, new int[]{5, 8}, "孙明"));
        courses.add(new Course(0, "数字逻辑", "品学楼B304", new int[]{1, 17}, 4, new int[]{1, 2}, "文泉"));
        courses.add(new Course(2, "计算机网络", "品学楼C407", new int[]{2, 14}, 4, new int[]{7, 8}, "龚海刚"));
        courses.add(new Course(0, "数据库", "品学楼A407", new int[]{2, 16}, 5, new int[]{3, 4}, "孙明"));
        courses.add(new Course(0, "数学建模方法", "立人楼B217", new int[]{5, 16}, 1, new int[]{5, 6}, "孙明"));

        return courses;
    }
}
